// window.onload=function(){
//   runpic();
//   returnTop();
//   ajax();
// }
app.controller("selectedController",["$scope","$http",function($scope,$http){

function returnTop(){
  // 返回顶部
      var top=document. querySelector('.backTop');
      window.onscroll=function(){
          var height=document.body.scrollTop;
          if(height>900){
            top.style.display='block';
          }else{
            top.style.display='none';
          }
        }
      };


// 解析数据
  $http.get('./selected/json/selected.json').success(function (data) {
      // console.log(data);
       var img1=data.resultData.resultFloorList[2].groupList[0].elementList[0].eproductImgA;
           $scope.img1 = img1;
       var fill1=document.querySelector('.fill1');
           fill1.src=img1;

       var img10=data.resultData.resultFloorList[2].groupList[0].elementList[1].eproductImgA;
           $scope.img10=img10;
       var fill2=document.querySelector('.fill2');
           fill2.src=img10;

       var img11=data.resultData.resultFloorList[2].groupList[0].elementList[2].eproductImgA;
           $scope.img11=img11;
       var fill3=document.querySelector('.fill3');
           fill3.src=img11;

       var img12=data.resultData.resultFloorList[2].groupList[0].elementList[3].eproductImgA;
           $scope.img12=img12;
       var fill4=document.querySelector('.fill4');
           fill4.src=img12;
             runPic();

       var img2=data.resultData.resultFloorList[3].groupList[0].elementIconList[0];
          $scope.lists1 = img2;

       var img3=data.resultData.resultFloorList[3].groupList[1].elementIconList[0];
          $scope.lists2 = img3;

       var title1=data.resultData.resultFloorList[4];
          $scope.title1=title1;

       var title2=data.resultData.resultFloorList[4].groupList[0].elementList;
          $scope.text=title2;

       var img4=data.resultData.resultFloorList[5];
          $scope.img4=img4;

       var img5=data.resultData.resultFloorList[5].groupList[0].elementList[0];
          $scope.img5=img5;

       var text2=data.resultData.resultFloorList[6].groupList[0].elementList;
          $scope.text2=text2;

       var p1=data.resultData.resultFloorList[7];
          $scope.p1=p1;
      var img6=data.resultData.resultFloorList[7].groupList[0].elementList;
          $scope.img6=img6;

      var img7=data.resultData.resultFloorList[8].groupList[0].elementList[0];
          $scope.img7=img7;
        // returnTop();
    });


    function runPic(){
      // 轮播图
      var mySwiper = new Swiper ('.noMove', {
        autoplayDisableOnInteraction : false,
        autoplay: 2000,
        loop:true,
        pagination: '.swiper-pagination'
      })
    };



}])
